const menulist = [{
	page_id:1,
	page_name:'专业管理',
	page_function:[
		{function_id:11,page_function_name:'新增'},
		{function_id:12,page_function_name:'编辑'},
		{function_id:13,page_function_name:'删除'},
	
	]
},{
	page_id:2,
	page_name:'年级管理',
	page_function:[
		{function_id:21,page_function_name:'新增'},
		{function_id:22,page_function_name:'编辑'},
		{function_id:23,page_function_name:'删除'},
		{function_id:24,page_function_name:'查看'},
		{function_id:25,page_function_name:'新增班级'},
	
	]
},{
	page_id:3,
	page_name:'职级管理',
	page_function:[
		{function_id:31,page_function_name:'新增'},
		{function_id:32,page_function_name:'编辑'},
		{function_id:33,page_function_name:'查看'},

	]
},{
	page_id:4,
	page_name:'角色管理',
	page_function:[
		{function_id:41,page_function_name:'新增'},
		{function_id:42,page_function_name:'编辑'},
		{function_id:43,page_function_name:'删除'},
		{function_id:44,page_function_name:'权限'}
	]
},{
	page_id:5,
	page_name:'教师管理',
	page_function:[
		{function_id:51,page_function_name:'新增'},
		{function_id:52,page_function_name:'编辑'},
		{function_id:53,page_function_name:'删除'},
]},{
	page_id:6,
	page_name:'学生管理',
	page_function:[
		{function_id:61,page_function_name:'新增'},
		{function_id:62,page_function_name:'编辑'},
		{function_id:63,page_function_name:'查看'},
		{function_id:64,page_function_name:'搜索'},
		{function_id:65,page_function_name:'审核'},
		{function_id:66,page_function_name:'删除'},
		{function_id:67,page_function_name:'学分'},
		{function_id:68,page_function_name:'表现'}
]}]

// 获取页面配置列表
const getMenuPageList =  ()=>{
   const list=[]
   menulist.forEach(item=>{
    const {page_id,page_name} = item
    const obj = {
        page_id,
        page_name,
    }
    list.push(obj)
   })
   return list
}
// 根据页面id数组获取页面及功能列表
const getMenuPageFunctionList = (page_id_arr)=>{
	console.log(page_id_arr,'getFn参数')
    const list=[]
    menulist.forEach(item=>{
        const {page_id,page_function} = item
        if(page_id_arr.includes(String(page_id))){
            const obj = {
                page_id,
                page_name:item.page_name,
                page_function
            }
            list.push(obj)
        }
    })
    return list	
}
module.exports = {
	getMenuPageList,
	getMenuPageFunctionList
}
